#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#include <gtk-3.0/gtk/gtk.h>


int* thread_callback(void *arg) {
    printf("我是子线程: %lu", pthread_self());  // 行缓冲
    fflush(NULL);
}

int main(int argc, char const *argv[])
{
    pthread_t thread;
    printf("main thread, ID is %lu\n", pthread_self());
    int ok = pthread_create(&thread, NULL, (void*)thread_callback, NULL);
    if (ok != 0) {
        printf("ok: %d\n", ok);
        exit(1);
    }
    
    sleep(10);
    return 0;
}

